package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.FollowRecordMapper;
import com.ruoyi.crm.domain.FollowRecord;
import com.ruoyi.crm.service.IFollowRecordService;

/**
 * 跟进记录Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-25
 */
@Service
public class FollowRecordServiceImpl implements IFollowRecordService
{
    @Autowired
    private FollowRecordMapper followRecordMapper;

    /**
     * 查询跟进记录
     *
     * @param id 跟进记录主键
     * @return 跟进记录
     */
    @Override
    public FollowRecord selectFollowRecordById(String id)
    {
        return followRecordMapper.selectFollowRecordById(id);
    }

    /**
     * 查询跟进记录列表
     *
     * @param followRecord 跟进记录
     * @return 跟进记录
     */
    @Override
    public List<FollowRecord> selectFollowRecordList(FollowRecord followRecord)
    {
        return followRecordMapper.selectFollowRecordList(followRecord);
    }

    /**
     * 新增跟进记录
     *
     * @param followRecord 跟进记录
     * @return 结果
     */
    @Override
    public int insertFollowRecord(FollowRecord followRecord)
    {
        return followRecordMapper.insertFollowRecord(followRecord);
    }

    /**
     * 修改跟进记录
     *
     * @param followRecord 跟进记录
     * @return 结果
     */
    @Override
    public int updateFollowRecord(FollowRecord followRecord)
    {
        followRecord.setUpdateTime(DateUtils.getNowDate());
        return followRecordMapper.updateFollowRecord(followRecord);
    }

    /**
     * 批量删除跟进记录
     *
     * @param ids 需要删除的跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteFollowRecordByIds(String[] ids)
    {
        return followRecordMapper.deleteFollowRecordByIds(ids);
    }

    /**
     * 删除跟进记录信息
     *
     * @param id 跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteFollowRecordById(String id)
    {
        return followRecordMapper.deleteFollowRecordById(id);
    }

    @Override
    public List<FollowRecord> selectByName(String name) {
        return followRecordMapper.selectByName(name);
    }
}